import axios from "axios";
import dataUrl from "@/config/env";

export default async (url:string,data:any,type="GET") =>{
  if(type==="GET"){
    if(data===null){
      return await axios.get(dataUrl+url);
    }
  }else{
    return await axios.post(dataUrl+url,data);
  }
}